package com.xianyun.book.domain.user;

import com.alibaba.cola.exception.BizException;

/**
 * 用户状态
 * @author mac_zyj
 */
public enum AccountStatus {
    /**活跃*/
    ACTIVITY("ACTIVITY"),
    /**潜水*/
    NOT_FREQUENT("NOT_FREQUENT"),
    /**注销*/
    LOGOUT("LOGOUT"),
    /**被封禁*/
    BAN("BAN");
    private String statusName;

    AccountStatus(String statusName) {
        this.statusName = statusName;
    }
    public static AccountStatus getAccountStatus(String status){
        for (AccountStatus current:values() ) {
            if (current.statusName.equals(status)){
                return current;
            }
        }
        throw new BizException("AccountStatus not found exception");
    }
}
